import java.awt.event.*;


public class SOPA {
	
public static void main(String args[])
{
	// The program models a complete computer with most HW components
	// The kernel, which is the software component, might have been
	// created here also, but Processor has a refernce to it and it
	// has a reference to the processor, so I decided that all software
	// is under the processor environment: kernel inside processor.
	
	IntController i = new IntController();
	// Create window console
	MyWin mw = new MyWin();
	
	mw.addWindowListener
	(
		new WindowAdapter()
		{
				public void windowClosing (WindowEvent e) { System.exit(0); }
		}
	);
	
	
	ConsoleListener c = mw.getListener();
	c.setInterruptController(i);
	Memory m	= new Memory(i,1024);
	Timer t	= new Timer(i);
	Disk d0	= new Disk(i,m,1024,"disk1.txt",0,"\t\t\t\t\t\t\t\t\t\t");
	Disk d1	= new Disk(i,m,1024,"disk2.txt",1,"\t\t\t\t\t\t\t\t\t\t\t\t");
	@SuppressWarnings("unused")
	Kernel k = new Kernel(m,c,i,d0,d1);
	// start all threads
	//CPU will be started at kernel
	t.start();
	d0.start();
	d1.start();
}

}
